local cahofuhe = fk.CreateSkill{
  name = "dajubei__chaofuhe",
}

Fk:loadTranslationTable{
  ["dajubei__chaofuhe"] = "超负荷",
  [":dajubei__chaofuhe"] = "当你使用一张基本牌后，你可令一名其他角色选择一项：1.收回一张装备牌；2.弃置一张手牌。",

  ["#dajubei__chaofuhe-choose"] = "超负荷：你可以令一名其他角色选择收回一张装备或弃置一张手牌",
  ["#dajubei__chaofuhe-card"] = "超负荷：请收回一张装备，或弃置一张手牌",

  ["$dajubei__chaofuhe1"] = "给你留点东西~",
  ["$dajubei__chaofuhe2"] = "唔，那个怪叔叔是谁？",
}

cahofuhe:addEffect(fk.CardUseFinished, {
  anim_type = "control",
  can_trigger = function (self, event, target, player, data)
    return target == player and player:hasSkill(cahofuhe.name) and data.card.type == Card.TypeBasic
    and table.find(player.room:getOtherPlayers(player), function (p) return not p:isNude() end)
  end,
  on_cost = function (self, event, target, player, data)
    local room = player.room
    local targets = table.filter(room:getOtherPlayers(player), function (p) return not p:isNude() end)
    local to = player.room:askToChoosePlayers(player, {
      targets = targets,
      max_num = 1,
      min_num = 1,
      skill_name = cahofuhe.name,
      cancelable = true,
      prompt = "#dajubei__chaofuhe-choose"
    })
    if #to > 0 then
      event:setCostData(self, to[1])
      return true
    end
  end,
  on_use = function (self, event, target, player, data)
    local room = player.room
    local to = event:getCostData(self)
    local cards = to:getCardIds("e")
    table.insertTable(cards, table.filter(to:getCardIds("h"), function (id) return not to:prohibitDiscard(id) end))
    local card = room:askToCards(to, {
      max_num = 1,
      min_num = 1,
      include_equip = true,
      skill_name = cahofuhe.name,
      cancelable = false,
      pattern = tostring(Exppattern{ id = cards }),
      prompt = "#dajubei__chaofuhe-card"
    })
    if table.contains(to:getCardIds("h"), card[1]) then
      room:throwCard(card, cahofuhe.name, to, to)
    else
      room:moveCardTo(card, Card.PlayerHand, to, fk.ReasonJustMove, cahofuhe.name, nil, true, to)
    end
  end
})

return cahofuhe